/*
 * Copyright (C) 2018-2020 Alibaba Group Holding Limited
 */

#ifndef __BOARD_H__
#define __BOARD_H__

#include <board_config.h>
#include "aec.h"

#ifdef __cplusplus
extern "C" {
#endif


#define SYS_OSC_CLK             24000000    // 24MHz
//#define MINI_STRUCTURE_LIGHT_MODULE

#define OUT_WINDOW_WIDTH    8
#define OUT_WINDOW_HEIGHT   8
#define SENSOR_SETPOINT             115
#define FACE_AE_SENSOR_SETPOINT     120
#define SENSOR_CALIB_SETPOINT       90
#define SENSOR_RIGHT_SETPOINT_INCR  0
#define SENSOR_LUME_DELTA           20
#define OV9282_MAX_GAIN_AEC     ( 15.0f )    /**< max. gain used by the AEC (arbitrarily chosen, recommended by Omnivision) */

#define IR_AEC_MEAN_CNT			(2)
#define IR_AEC_EXP_CNT			(2)
#define IR_AWB_CNT			    (2)

//#define ISP_AEC_EXP_LINES       984.0f
//#define ISP_FPS                 30.0f
//#define ECM_TFLICKER_OFF    	(1.0f / (ISP_FPS * ISP_AEC_EXP_LINES))
//#define  FACE_FEATURE_MAX_NUM          1000


#define OV2732_IR_AEC_AGAIN_MAX         (15.0f)             /* max = 15x */
#define OV2732_IR_AEC_AGAIN_MIN         (1.0f) // (2.0f)


#define AE_LOCK_AGAIN_DIFF  0.01f
#define AE_LOCK_EXP_DIFF 0.0001f
#define AE_LOCK_FORCED_COUNT    3

#define FACE_AE_GAIN_OUTDOOR       (OV2732_IR_AEC_AGAIN_MIN)
#define FACE_AE_INTI_OUTDOOR       (0.005f)	

#define ISP_AEC_EXP_LINES       1184.0f
#define ISP_FPS                 20//30.0f
#define ECM_TFLICKER_OFF        (1.0f / (ISP_FPS * ISP_AEC_EXP_LINES))
#define  FACE_FEATURE_MAX_NUM          100

#define FACE_AE_INIT_GAIN       (OV2732_IR_AEC_AGAIN_MAX * 1 / 30)
#define FACE_AE_INIT_INTI       (1.0f / ISP_FPS)	

#define RGB_AEC_SCENE_MODE      AEC_SCENE_EVALUATION_FIX
#define IR_AEC_SCENE_MODE      AEC_SCENE_EVALUATION_FIX


#define RELEASE_SOFT_VERSION "V2R1C05B013"

#define FOCAL_LENGTH_3D 407.403f

#define FS_ROOT_PATH "/sdcard"

/**
 * @brief  init mtd.
 * re-implement if need.
 * @return
 */
void mtd_init(void);

#ifdef __cplusplus
}
#endif

#endif /* __BOARD_H__ */

